{include file="public/hunanconstr_meta" /}
<link href="__PUBLIC_ADMIN__css/plugins/footable/footable.core.css" rel="stylesheet">
<link href="__PUBLIC_ADMIN__js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
<style>
#huiedit{
	background-color: #1ab394;
	color: #FFFFFF;
}
#huidel{
	background-color: #ed5565;
	color: #FFFFFF;
}
#hui{
	 width: 50px;
        height: 50px;
}

</style>
</head>

<body class="gray-bg">
   <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>所有项目</h5>
                        <div class="ibox-tools">
                            <a href="{:url('admin/Hunanconstr/project_add')}" class="btn btn-primary btn-xs">创建新项目</a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row m-b-sm m-t-sm">
                            <div class="col-md-1">
                                <button style="margin-top: 5px;" type="button" id="loading-example-btn" class="btn btn-white btn-sm refresh"><i class="fa fa-refresh"></i> 刷新</button>
                            </div>
                            <div class="col-md-11">
		                    	<form action="{:url('admin/Hunanconstr/project_list')}" method="post" enctype="multipart/form-data" role="form" class="form-inline">
		                            <div class="form-group" style="margin-right: 20px;">
		                                <label for="exampleInputEmail2" class="">项目名称:</label>
		                                <input type="text" id="project_name" name="project_name" value="{$search.project_name}" placeholder="请输入项目名称" class="form-control">
		                            </div>
		                            
		                            <div class="form-group" style="margin-right: 20px;">
		                                <label for="exampleInputPassword2" class="">所属企业:</label>
		                                <select class="form-control" id="company_id" name="company_id">
		                                	<option value="">请选择所属企业</option>
	                                        {foreach $company as $vo}
	                                        <option value="{$vo.id}">{$vo.company_name}</option>
	                                        {/foreach}
	                                    </select>
		                            </div>
		                            
		                            <div class="form-group" style="margin-right: 20px;">
		                                <label for="exampleInputPassword2" class="">合同:</label>
		                                <select class="form-control" id="pact_status" name="pact_status">
		                                	<option value="">请选择合同</option>
	                                        <option value="1">已签</option>
	                                        <option value="0">未签</option>
	                                    </select>
		                            </div>
		                            
		                            <div class="form-group" style="margin-right: 20px;">
		                                <label for="exampleInputPassword2" class="">项目状态:</label>
		                                <select class="form-control" id="project_status" name="project_status">
		                                	<option value="">请选择项目状态</option>
	                                        <option value="1">正常</option>
	                                        <option value="2">完成</option>
	                                        <option value="0">滞后</option>
	                                    </select>
		                            </div>
		                            
		                            <button class="btn btn-white " type="submit" style="margin-top: 5px;">搜索</button>
		                            
		                            <a id="clearAll" class="btn btn-white" href="#" style="margin-top: 5px;">清空</a>
		                        </form>
                            </div>
                        </div>
                        <table class="  table table-stripped toggle-arrow-tiny" data-page-size="50" data-filter=#filter>
                       	 	<thead>
                                <tr>
                                    <th width="200"><font color="#228B22">项目总数:</font><font>{$arr.number}</font></th>
                                    <th width="200"><font color="#228B22">已开工:</font><font>{$arra.number}</font></th>
                                    <th width="200"><font color="#228B22">正常项目:</font><font>{$arraa.number}</font></th>
                                    <th width="200"><font color="#228B22">滞后项目:</font><font>{$lagProject}</font></th>
                                </tr>
                            </thead>
                        </table>
                        
						<table class="footable  table table-stripped toggle-arrow-tiny" data-page-size="50" data-filter=#filter>
                            <thead>
                                    <tr>
                                        <th width="70">项目ID</th>
                                        <th width="">项目名称</th>
                                        <th width="">公司名称</th>
                                        <th width="">计划竣工时间</th>
                                        <th width="">进度</th>
                                        <th width="">工程造价</th>
                                        <th width="">建筑面积</th>
                                        <th width="">项目状态</th>
                                        <th width="">验收验证</th>
                                        <th width="">建造记录</th>
                                        <th width="">云相册</th>
                                        <th width="170">操作</th>
                                        <th data-hide="all">滞后原因</th>
                                        <th data-hide="all">编辑时间</th>
                                        <th data-hide="all">创建时间</th>
                                    </tr>
                                </thead>
                                <tbody>
                                	{foreach name="res" id="vo" key="key"}
                                    <tr class="gradeX">
										<td>{$vo.project_no}</td>
										<td>{$vo.project_name|mb_substr=0,30,'utf-8'}</td>
										<td>{$vo.item_name}</td>
										<td>{$vo.plan_finish_time}</td>
										<td>{$vo.progress}%</td>
										<td>{$vo.plan_output_total}</td>
										<td>{$vo.total_area}</td>
										<td>
	                                        {if condition="$vo.project_status eq 1"}正常
	                                        {elseif condition="$vo.project_status eq 2"}完成
	                                        {else}滞后
	                                        {/if}
                                        </td>
                                        <td>
	                                        <a href="{:url('admin/Hunanconstr/memorabilia',['id'=>$vo.id])}">
	                                        	<span class="label label-primary">验收验证</span>
	                                       	</a>
                                        </td>
										<td>
                                         <a href="{:url('admin/Hunanconstr/framed_Data',['id'=>$vo.id])}" id="huidel" ><span class="label label-primary">建造记录</span></a>
                                        </td>
                                        <td>
                                         <a href="{:url('admin/Hunanconstr/CloudAlbum',['id'=>$vo.id])}" id="huidel" ><span class="label label-primary">云相册</span></a>
                                        </td>
										<td>
										{if condition="$vo.review_status eq 1"}
                                        <a href="{:url('admin/Hunanconstr/project_cat_list',['id'=>$vo.id])}" id="huiedit" class="btn btn-white btn-sm">查看 </a>
                                        {else}
                                        {/if}
                                        <a href="{:url('admin/Hunanconstr/project_edit',['id'=>$vo.id])}" id="huiedit" class="btn btn-white btn-sm">编辑 </a>
                                        <a onClick="return confirm('确定删除?');" href="{:url('admin/Hunanconstr/project_del',['id'=>$vo.id])}" id="huidel" class="btn btn-white btn-sm">删除</a>
                                        </td>
                                        <td>{$vo.delay_reason}</td>
                                        <td>{$vo.update_time|date="Y-m-d",###}</td>
                                        <td>{$vo.create_time|date="Y-m-d",###}</td>
                                    </tr>  
                                    {/foreach}  
                                </tbody>
                                <tfoot hidden="hidden">
                                    <tr>
                                        <td colspan="5">
                                            <ul class="pagination pull-right"></ul>
                                        </td>
                                    </tr>
                                </tfoot>   
                        </table>
                        <div class="item-page" style="padding-left:600px;">
                        {$page}
						</div> 
                    </div>
                </div>
            </div>
        </div>
    </div>
        
    {include file="public/hunanconstr_footer" /}
	<script src="__PUBLIC_ADMIN__js/plugins/footable/footable.all.min.js"></script>
	
    <!-- Fancy box -->
    <script src="__PUBLIC_ADMIN__js/plugins/fancybox/jquery.fancybox.js"></script>   
    <script>
        $(document).ready(function () {
            $('.fancybox').fancybox({
                openEffect: 'none',
                closeEffect: 'none'
            });
        });
    </script>  

    <!-- 自定义js -->
    <script src="__PUBLIC_ADMIN__js/content.js?v=1.0.0"></script>
    <script>
        $(document).ready(function() {
        	$("#company_id").val("{$search.company_id}");
        	$("#pact_status").val("{$search.pact_status}");
        	$("#project_status").val("{$search.project_status}");
        	
        	$("#clearAll").click(function(){
        		$("#project_name").val("");
        		$("#company_id").val("");
            	$("#pact_status").val("");
            	$("#project_status").val("");
        	})
        	
            $('.footable').footable();
            $('.footable2').footable();
			
            $('.refresh').click(function(){
            	window.location.reload();	// 刷新页面
            })
            
          	//iframe窗
          	$('.edit').click(function(){
          		var index = layer.open({
          			type : 2,
					fixed: true,
					scrollbar: false,
					title : '编辑',
					shadeClose : false,
					maxmin : true, //开启最大化最小化按钮
					area : ['893px', '600px'],
					//offset: '100px',
					content : '{:url("admin/admin/edit")}'
          		});
          		layer.full(index);
          	})
		});
	</script>
</body>
</html>
